-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_HAL_ChibiOS: Add support for STM32F413xx #28845
base: master
Are you sure you want to change the base?
AP_HAL_ChibiOS: Add support for STM32F413xx #28845
Conversation
Generated the STM32F413xx script from reference manuals and datasheets Added changes for supporting STM32F413 to mcuconf
We are using a board with an STM32F413 - Best I can see, there have been requests (issue#8832) and attempts to add support for STM32F413xx in the past, but appears the MCU definition has never been added. I've used the Ref Man and datasheet to pull out the CSV required to run the parser scripts. We have a build running on the F413, seemingly without issues. I'd be keen for a backport to periph stable if it makes sense to do so - though I've not built with this on stable yet. |
fails because of iterator not returning strings and 'dict' object has no attribute 'iterkeys'. Fixed so both scripts run.
1b26522
to
2c3467c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove the drive-by's this looks correct to me and safe to go in
@@ -28,7 +28,7 @@ def is_pin(str): | |||
return False | |||
|
|||
def parse_adc_table(fname, table): | |||
csvt = csv.reader(open(fname,'rb')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should remove this drive-by
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't consider this to be drive by given the script doesn't run without the change, and you can't generate the table without the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah apologies, did not realise that was what it was for
@@ -86,10 +86,10 @@ def parse_af_table(fname, table): | |||
|
|||
parse_af_table(sys.argv[1], table) | |||
|
|||
sys.stdout.write("AltFunction_map = {\n"); | |||
sys.stdout.write("AltFunction_map = {\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
sys.stdout.write('\t# format is PIN:FUNCTION : AFNUM\n') | ||
sys.stdout.write('\t# extracted from %s\n' % os.path.basename(sys.argv[1])) | ||
for k in sorted(table.keys(), key=cmp_to_key(pin_compare)): | ||
s = '"' + k + '"' | ||
sys.stdout.write('\t%-20s\t:\t%s,\n' % (s, table[k])) | ||
sys.stdout.write("}\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -11,7 +11,7 @@ | |||
|
|||
def parse_dma_table(fname, table): | |||
dma_num = 1 | |||
csvt = csv.reader(open(fname,'rb')) | |||
csvt = csv.reader(open(fname,'r')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -78,7 +78,7 @@ def check_full_table(table): | |||
sys.stdout.write('\t# format is (DMA_TABLE, StreamNum, Channel)\n') | |||
sys.stdout.write('\t# extracted from %s\n' % os.path.basename(sys.argv[1])) | |||
|
|||
for k in sorted(table.iterkeys()): | |||
for k in sorted(table.keys()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
"I2S3_EXT_RX" : [(1,2,2),(1,0,3)], | ||
"I2S3_EXT_TX" : [(1,5,2)], | ||
"QUADSPI" : [(2,7,3)], | ||
"SAI1B" : [(2,4,1)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference manual calls this out separately to SAI1_B
- I suspect this is a typo, I'll fix this up when I have a moment.
Generated the STM32F413xx python module from datasheet (
stm32f413cg
) and reference manual (rm0430-stm32f413423-advanced-armbased-32bit-mcus-stmicroelectronics
).Added changes for supporting STM32F413xx to mcuconf.